package br.com.absolutech.study.chapter9.pag390;

class NameRunnable implements Runnable {
	public void run() {
		for (int x = 1; x < 33; x++) {
			System.out.println("Run by " + Thread.currentThread().getName()
					+ " , x is " + x);
		}
	}
}


public class ManyNames {

	public static void main(String[] args) {

		//cria um runnable
		NameRunnable nr = new NameRunnable();

		Thread one = new Thread(nr);
		one.setName("Fred");
		Thread two = new Thread(nr);
		two.setName("Lucy");
		Thread three = new Thread(nr);
		three.setName("Ricky");
		one.start();
		two.start();
		three.start();
	}
}
